# VERSION 0.0.1
# 默认ubuntu server长期支持版本，当前是14.04
FROM ubuntu:14.04

# 签名
MAINTAINER yangpengfei "jrunner@126.com"

#RUN apt-get -y remove mysql-server
#RUN apt-get -y autoremove
RUN apt-get update
RUN apt-get -y install curl
RUN echo "deb http://repo.mysql.com/apt/ubuntu/ precise mysql-apt-config" >> /etc/apt/sources.list.d/mysql.list
RUN echo "deb http://repo.mysql.com/apt/ubuntu/ precise mysql-5.6" >> /etc/apt/sources.list.d/mysql.list
RUN curl -s http://ronaldbradford.com/mysql/mysql.gpg | sudo apt-key add -
RUN apt-get update
RUN export DEBIAN_FRONTEND=noninteractive
RUN apt-get -y install mysql-server

RUN echo "添加脚本及文件"
ADD my.cnf /etc/mysql/my.cnf
ADD run.sh /opt/bin/run.sh
RUN chmod 755 /opt/bin/*.sh

#开放端口
EXPOSE 3306

CMD ["/etc/init.d/mysql","start"]

